<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>日程管理系统 - 登录</title>
  <link href="/css/bootstrap.css" rel="stylesheet">
  <script src="/js/jquery-3.5.1.min.js" crossorigin="anonymous"></script>
  <script src="/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
  <style>
    body {
      background-color: #f7f7f7;
    }
    .container {
      max-width: 400px;
      margin-top: 250px;
      padding: 20px;
      background: white;
      border-radius: 5px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }
    .form-signin-heading {
      margin-bottom: 20px;
    }
    .text-danger {
      text-align: center;
    }
  </style>
</head>
<body>
<div class="container">
  <form class="form-signin" method="post" th:action="@{/login}">
    <h3 class="form-signin-heading text-center">日程管理系统</h3>

    <!-- 注销成功提示 -->
    <div th:if="${logout}" class="alert alert-success" role="alert">
      成功注销！请重新登录。
    </div>

    <div class="form-group">
      <label for="inputUsername" class="sr-only">用户名</label>
      <input type="text" id="inputUsername" name="username" class="form-control" placeholder="用户名" required autofocus>
    </div>
    <div class="form-group">
      <label for="inputPassword" class="sr-only">密码</label>
      <input type="password" id="inputPassword" name="password" class="form-control" placeholder="密码" required>
    </div>

    <p class="text-danger" th:if="${message}" th:text="${message}"></p> <!-- 显示错误信息 -->

    <button class="btn btn-lg btn-primary btn-block" type="submit">登录</button>
    <a class="btn btn-lg btn-outline-secondary btn-block" href="/register">注册</a>
  </form>
</div>
</body>
</html>
